<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    ul {
      list-style: none;
    }

    .mi {
      position: relative;
      width: 223px;
      margin: 100px auto;
    }

    .mi input {
      width: 223px;
      height: 48px;
      padding: 0 10px;
      font-size: 14px;
      line-height: 48px;
      bottom: 1px solid #e0e0e0;
      outline: none;
    }

    .mi .search {
      border: 1px solid #ff6700;

    }
    .result-list {
      position: absolute;
      left: 0;
      top: 48px;
      width: 223px;
      bottom: 1px solid #ff6700;
      border-top: 0;
      background:#fff;
    }

    .result-list{
      display: block;
      padding: 6px 15px;
      font-style: 12px;
      color: #424242;
      text-decoration: none;
    } 
  </style>
</head>
<body>
    <!-- <input type="text"> -->
  <div class="mi">
    <input type="search" placeholder="小米笔记本">
    <ul class="result-list">
      <li>全部商品</li>
      <li>小米11</li>
      <li>小米10S</li>
      <li>小米笔记本</li>
      <li>小米手机</li>
      <li>黑鲨4</li>
      <li>空调</li>
    </ul>
  </div>

    <script>
      const input = document.querySelector('input')
      input.addEventListener('focus',function(){
        console.log('有焦点触发')
      })
      input.addEventListener('focus',function(){
        console.log('失去焦点触发')
      })
    </script>
</body>
</html>